<!DOCTYPE html>
<!--
 *  创建时间: 2020-08-05-14:32
 *  作   者: lpc
 *  Email : lpc@hll520.cn
-->
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>管理员登录</title>
    <!-- JQuery -->
    <script type="text/javascript" src="/static/js/jquery.min.js"></script>
    <!-- Bootstrap核心CSS和JS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <!-- 登录页样式 -->
    <link href="https://v3.bootcss.com/examples/signin/signin.css" rel="stylesheet">
    <!--  -->
    <script type="text/javascript">
        $(function () {
            /* 获取用户信息 */
            $.getJSON(
                "/user/getInfo",
                {},
                function (json) {
                    if (json.statusCode !== 200) {

                    } else {
                        $("#nav_login").html(`
                        <a href="/space">
                        <span class="glyphicon glyphicon-user"></span>
                        <span id="userName">${json.data.realname}</span></a>
                        `);

                        $("#nav_register").html(`
                    <a href="/user/signOut">安全退出</a>
                    `);

                    }
                },
                "json"
            );
        })
    </script>
</head>

<body>

<div class="container">

    <!-- 导航 -->
    <div class="row clearfix">
        <div class="col-md-12 column">
            <!-- 导航 -->
            <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
                <div class="navbar-header">
                    <button class="navbar-toggle" data-target="#bs-example-navbar-collapse-1" data-toggle="collapse"
                            type="button"><span
                            class="sr-only">WTUShop导航栏</span><span class="icon-bar"></span><span
                            class="icon-bar"></span><span class="icon-bar"></span></button>
                    <a class="navbar-brand" href="/">WTUShop</a>
                </div>

                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <!-- 左边 -->
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="/goods/search">商场</a></li>
                        <li><a href="/kill/list">秒杀活动</a></li>
                        <li><a href="/space/">个人中心</a></li>
                        <li><a href="/admin/manage">控制台</a></li>
                    </ul>
                    <!-- 右边 -->
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="/shopping/list">购物车</a></li>
                        <li><a href="/order/list">订单查询</a></li>
                        <li id="nav_login"><a href="/login"><span
                                class="glyphicon glyphicon-user"></span><span id="uName">请登录</span></a></li>
                        <li id="nav_register"><a href="/register">注册</a></li>
                        <li>&nbsp;&nbsp;</li><!-- 占位符 -->
                    </ul>
                </div>

            </nav>
        </div>
    </div>

    <form class="form-signin" action="/sa/login" method="post">
        <h2 class="form-signin-heading">管理员登录</h2>
        <label for="username" class="sr-only">用户名</label>
        <input type="text" id="username" name="username" class="form-control" placeholder="请输入用户名" required autofocus>
        <label for="password" class="sr-only">密 码</label>
        <input type="password" id="password" name="password" class="form-control" placeholder="请输入密码" required>
        <button class="btn btn-lg btn-primary btn-block" type="submit">登 录</button>
    </form>

</div>

</body>
</html>